package com.aikon.wht.algorithm.bubble;

import java.util.Arrays;

/**
 * @author haitao.wang
 *
 */
public class TestOfBubble {

	private static Integer[] arr = { 20, 10, 30, 50, 40, 90, 80, 100, 60, 70, 3, 3, 24, 6, 56, 345, 3, 345, 567, 658,
			334, 5, 576, 67, 8, 32, 453, 32, 55456, 7, 2 };

	public static void main(String[] args) {
		Long t1 = System.nanoTime();
		for (int i = 0; i < arr.length; i++) {
			for (int j = i; j < arr.length; j++)
				if (arr[i] < arr[j]) {
					Integer tmp = arr[j];
					arr[j] = arr[i];
					arr[i] = tmp;
					continue;
				}
		}
		Long t2 = System.nanoTime();
		System.out.println(t2 - t1);
		System.out.println(Arrays.asList(arr));
	}
}
